#ifndef ULTRASONICSENSORTEST_H
#define ULTRASONICSENSORTEST_H

#include <QDialog>
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
#include <QTableView>
#include <QComboBox>
#include <QDebug>
#include <QtSerialPort/QSerialPortInfo>
#include <QtSerialPort/QSerialPort>
#include "modbus.h"

class UltrasonicSensor;

namespace Ui {
    class UltrasonicSensorTest;
}

class UltrasonicSensorTest:public QDialog
{
    Q_OBJECT

public:
    explicit UltrasonicSensorTest(QWidget *parent = 0);
    ~UltrasonicSensorTest();

private slots:
    void on_Powter_Noise_Button_clicked();

    void on_Detect_Range_Button_clicked();

    void on_RS485_Address_Button_clicked();

    void on_Data_Send_Button_clicked();

    void on_Begin_Detect_Button_clicked();

    void on_DeviceId_Button_clicked();

    void on_Data_Send_Button_test_clicked();

    void on_button_setEnable_clicked();

private:
    void initialSerials_modbus();

private:
    Ui::UltrasonicSensorTest *ui;
    UltrasonicSensor *ultrasonicSensor;
    QSerialPort serialPort;
    QSerialPortInfo serialPortInfo;
    bool button_stat;
    QStringList strlist;
    QString str;

    modbus_t* modbusMaster;
};

#endif // ULTRASONICSENSORTEST_H
